<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta names="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
    <title>Hackthon</title>
    <script src="libs/jquery-3.2.1.min.js"></script>
    <script src='js/data.js'></script>
    <style>
        .button {
            margin: 2rem;
            background: red;
            line-height: 3rem;
            padding: 1rem;
            display: block;
            text-align: center;
            color: white;
            font-weight: bold;
        }

    </style>

    <script>
      function getUserId() {
        return parseInt($("#inputUser").val());
      }

      $(function() {
        $("#btnJoinGroup").click(function() {
          window.hackthon.joinGroup(getUserId());
          window.hackthon.joinGroup(1);
        });
        $("#btnAttack").click(function() {
          window.hackthon.attack(1, getUserId());
        });
        $("#btnRebirth").click(function() {
          window.hackthon.rebirth(1);
        });
      });
    </script>
</head>
<body>
<div class="frame">
    <div style="margin: 3rem;font-size:1rem;">User ID: <input id="inputUser" style="border:1px solid grey;"/></div>
    <span id="btnJoinGroup" class="button">
        加入组
    </span>
    <span id="btnAttack" class="button">
        攻击
    </span>
    <span id="btnRebirth" class="button">
        重生
    </span>
</div>
</body>
</html>